home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19950929-19951130
/
000167_news@columbia.edu_Sat Oct 21 15:12:07 1995.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA05413
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Sat, 21 Oct 1995 11:12:12 -0400
Received: by apakabar.cc.columbia.edu id AA25234
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Sat, 21 Oct 1995 11:12:10 -0400
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Is there a bug in fonction \Fcode(Char)
Date: 21 Oct 1995 15:12:07 GMT
Organization: Columbia University
Lines: 79
Message-Id: <46b2k7$okf@apakabar.cc.columbia.edu>
References: <468l5o$sai@midgard.calvacom.fr>
Nntp-Posting-Host: watsun.cc.columbia.edu
Apparently-To: kermit.misc@watsun.cc.columbia.edu
In article <468l5o$sai@midgard.calvacom.fr>,
Dominique Ottello <do11@calvacom.fr> wrote:
: I think there is a bug into Kermit MS-DOS Version 3.14
: The fonction \Fcode(Char) return the value 150 for a space as for
: u-circomflex. I try this :
:
: define line == SERIAL NUMBER : D00536 ==
: ;
: ; Search for position of (:) into Line
: assign Begin \Findex(:,\m(Ligne),1)
: increment Begin
: ;
: ; Extract substring beginning after (:) to the end of Line into SN2End
: assign SN2End \Fsubstr(\m(Line),\m(Begin),)
: ;
: define \%n 1
: :Bcl
: assign Tmp \Fsubstr(\m(SN2End),\%n,1)
: ;
: assign Ascii \Fcode(\m(Tmp))
: echo {Char=\m(Tmp) Code=\m(Ascii)}
: ;
: ; Test if the character is a Space
: if = \m(Ascii) 32 goto LenOK
: increment \%n
: goto Bcl
: ;
: :LenOK
: decrement \%n
: assign SN \Fsubstr(\m(SN2End),1,\%n)
: echo Line=\M(Line)
: echo {SN extracted from Line=\m(SN)}
:
: There are spaces after D00536 into variable Line,
: but the fonction \Fcode(\m(Tmp)) always return 150 when Tmp is a space.
: So, I am not able to test where ends the serial number.
:
: Is there a patch to correct this problem ?
: Or is there any possibility to do this test another way ?
:
It is indeed a problem. It seems that in MS-DOS Kermit, when a variable
has a value of SPACE (ASCII 32), it just disappears, so in your script
program, \Fcode(\m(tmp)) is taking the value of a random memory byte. You
can work around this problem as follows:
---(cut)---
define line == SERIAL NUMBER : D00536 ==
;
echo LINE="\m(line)"
; Search for position of (:) into Line
assign Begin \Findex(:,\m(Line),1) ;; <--- "Line", not "Ligne"
increment Begin
;
; Extract substring beginning after (:) to the end of Line into SN2End
assign SN2End \Fsubstr({\m(Line)},\m(Begin),)
define \%n 1
assign length \flength(\m(SN2End)) ; Get length of substring
:Bcl
assign Tmp _\Fsubstr({\fdef(SN2End)},\%n,1)_ ; Put _ before and after char
assign Ascii \Fcode(\Fsubstr(\m(TMP),2,1)) ; Get code of char between _'s
; Test if the character is a Space
if = \m(Ascii) 32 goto LenOK
increment \%n
if > \%n \m(length) stop 1 END OF STRING... ; Avoid infinite loop
goto Bcl
;
:LenOK
decrement \%n
assign SN \Fsubstr(\m(SN2End),1,\%n)
echo Line=\M(Line)
echo {SN extracted from Line="\m(SN)"}
---(cut)---
- Frank